package com.czc.demo.service;

import javax.annotation.Resource;
import com.czc.demo.model.User;
import com.czc.demo.repository.UserRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Resource
    private UserRepository userRepository;


    public void save(User user) {
        userRepository.save(user);
    }

    public Page<User> getAll(Pageable pageable){
        return  userRepository.findAll(pageable);
    }

}